package crs.perfiles.model;
// Generated 22-ene-2015 14:35:18 by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

import crs.users.model.Users;

/**
 * CrsPerfilMedico generated by hbm2java
 */
@Entity
@Table(name = "crs_perfil_medico", schema = "public")
public class CrsPerfilMedico implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int medicoid;
	private Users users;
	private String nocolegiado;
	private String firma;
	private Set crsInformeses = new HashSet(0);

	public CrsPerfilMedico() {
	}

	public CrsPerfilMedico(Users users, String nocolegiado) {
		this.users = users;
		this.nocolegiado = nocolegiado;
	}

	public CrsPerfilMedico(Users users, String nocolegiado, Set crsInformeses) {
		this.users = users;
		this.nocolegiado = nocolegiado;
		this.crsInformeses = crsInformeses;
	}

	@GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "users"))
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "medicoid", unique = true, nullable = false)
	public int getMedicoid() {
		return this.medicoid;
	}

	public void setMedicoid(int medicoid) {
		this.medicoid = medicoid;
	}

	@OneToOne(fetch = FetchType.LAZY)
	@PrimaryKeyJoinColumn
	public Users getUsers() {
		return this.users;
	}

	public void setUsers(Users users) {
		this.users = users;
	}

	@Column(name = "nocolegiado", nullable = false, length = 20)
	public String getNocolegiado() {
		return this.nocolegiado;
	}

	public void setNocolegiado(String nocolegiado) {
		this.nocolegiado = nocolegiado;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "crsPerfilMedico")
	public Set getCrsInformeses() {
		return this.crsInformeses;
	}

	public void setCrsInformeses(Set crsInformeses) {
		this.crsInformeses = crsInformeses;
	}

	@Column(name = "firma", nullable = false, length = 300)
	public String getFirma() {
		return firma;
	}

	
	public void setFirma(String firma) {
		this.firma = firma;
	}

}
